package com.share.service;

import org.elasticsearch.client.transport.TransportClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author sunxuejian
 * @date 2020/6/29
 */
@Service
public class NearbyService {

    @Autowired
    private TransportClient transportClient;

    private String indexName = "nearby";
    private String typeName = "wechat";


    public void recreateIndex() {


        if(transportClient.admin().indices().prepareExists(indexName).execute().actionGet().isExists()) {
            return;
        }
        transportClient.admin().indices().prepareDelete(indexName).execute().actionGet();
    }

    public void createIndex() {

    }


}
